DEMO #1: In this activity, you'll see how we can use a variable inside a loop as a counter.

We use loops to repeat a step, or set of steps, in a program.

The range in a for loop is the number of times the loop runs.

The loop variable, counter, increases by 1 each time the loop runs.

  • Click Run to start the demo and use the directions on the stage to navigate through the activity.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)